{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c341dbda-dff0-4c43-88ca-c5eb79956839",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "s_int= tf.Tensor(100, shape=(), dtype=int32)\n",
      "s_float= tf.Tensor(25.87, shape=(), dtype=float32)\n",
      "v_int= tf.Tensor([10], shape=(1,), dtype=int32)\n",
      "v_float= tf.Tensor([2.5 8.7], shape=(2,), dtype=float64)\n",
      "m_int= tf.Tensor(\n",
      "[[1 2 3]\n",
      " [4 5 6]], shape=(2, 3), dtype=int32)\n",
      "m_float= tf.Tensor(\n",
      "[[2.5 8. ]\n",
      " [1.8 3. ]\n",
      " [2.6 1.5]], shape=(3, 2), dtype=float32)\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "s_int=tf.constant(100)\n",
    "s_float=tf.constant(25.87)\n",
    "print (\"s_int=\",s_int)\n",
    "print(\"s_float=\",s_float)\n",
    "v_int=tf.constant([10])\n",
    "v_float=tf.constant([2.5,8.7],dtype=tf.float64)\n",
    "print (\"v_int=\",v_int)\n",
    "print(\"v_float=\",v_float)\n",
    "m_int=tf.constant([[1,2,3],[4,5,6]])\n",
    "m_float=tf.constant([[2.5,8.],[1.8,3.],[2.6,1.5]])\n",
    "print (\"m_int=\",m_int)\n",
    "print(\"m_float=\",m_float)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f8c539ae-29e5-4fde-a589-9972a25a2f8a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tf.Tensor([ 1  5 10 15], shape=(4,), dtype=int32)\n",
      "tf.Tensor(6, shape=(), dtype=int32)\n",
      "tf.Tensor([0 3], shape=(2,), dtype=int32)\n",
      "tf.Tensor([ 9 15  8], shape=(3,), dtype=int32)\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "a=tf.constant([[0,3,6,9],[1,5,10,15],[2,4,6,8]])\n",
    "print(a[1])\n",
    "print(a[2][2])\n",
    "print(a[0,0:2])\n",
    "print(a[:,-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "36970931-9c32-4ed8-8abb-586cd858c287",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a= tf.Tensor(\n",
      "[[ 0  3  6  9]\n",
      " [ 1  5 10 15]\n",
      " [ 2  4  6  8]], shape=(3, 4), dtype=int32)\n",
      "b= tf.Tensor(\n",
      "[[ 0  3  6  9  1  5]\n",
      " [10 15  2  4  6  8]], shape=(2, 6), dtype=int32)\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "a=tf.constant([[0,3,6,9],[1,5,10,15],[2,4,6,8]])\n",
    "print(\"a=\",a)\n",
    "b=tf.reshape(a,(2,6))\n",
    "print(\"b=\",b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "24728f88-8fd3-40a7-b70b-078acbaea5fe",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
